package com.rede.didiok.user.modulelist.rank.web;

import javax.annotation.Resource;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.rede.didiok.common.dto.rank.RankReportDto;
import com.rede.didiok.common.exception.ThrowableUtils;
import com.rede.didiok.common.utils.ResultUtil;
import com.rede.didiok.common.validator.group.GetList;
import com.rede.didiok.user.modulelist.rank.service.RankReportService;

/**
 * 举报接口 RestApi
 *
 * @author 遇见
 * @date 2018-09-04
 */
@RestController
@RefreshScope
@RequestMapping("/rank/feign/report")
@Api(value = "举报相关接口", tags = {"举报相关接口"})
@Slf4j
public class RankReportController {
    /**
     * 举报模块服务
     */
    @Resource
    RankReportService rankReportService;

    @ApiOperation(value = "获取举报列表", notes = "获取举报列表", response = String.class)
    @PostMapping("/getList")
    public String getList(@Validated({GetList.class}) @RequestBody RankReportDto reportDto, BindingResult result) {

        ThrowableUtils.checkParamArgument(result);
        return ResultUtil.successWithData(rankReportService.getPageList(reportDto));
    }

}
